import json
import requests
import sys
from python766709418271084544_170930101 import *

def func(data):
    return reTest.test(data)




if __name__ == '__main__':
    # step1
    jsonStr = sys.argv[1]
    # jsonStr = "{\"name\":\"曾智\",\"id\":\"500235199212260331\"}"
    # # 编写python 调用 java 数据网关的接口返回 数据
    std = json.loads(jsonStr)
    varStd=json.loads(std)
    # print(std)
    # result dict result的类型
    # 把字典转成字符串
    result={"apiName":"身份证二要素验证","secret":"abfa041cc7a84419957ca69421bb0680","shortName":"br"}
    result["name"]=varStd["name"]
    result["id"]=varStd["id"]
    str = json.dumps(result)
    # 调用数据网关接口 得到结果
    host = 'http://zebra.sit.com/service-interface-gateway/api/invoke'
    requests.DEFAULT_RETRIES = 10# 增加重试连接次数
    s = requests.session()
    s.keep_alive = False
    header_dict = {"Content-Type": "application/json; charset=utf8"}
    r = requests.post(host, data=str, headers=header_dict,timeout=300)
    json_data = ''
    if (r.ok):
        json_data = r.json()
    print(func(json_data))